package com.augurit.gzcgwsp.sendNotice.dao;

import java.util.List;

import org.hibernate.Query;
import org.springframework.stereotype.Repository;

import com.augurit.common.base.dao.BaseDao;
import com.augurit.gzcgwsp.sendNotice.entity.YwClosecase;

@Repository
public class YwClosecaseDao extends BaseDao<YwClosecase, Long>{

	
	public List<YwClosecase> getNoticeYwClosecase(){
		List<YwClosecase> list=null;
		String hql = "from YwClosecase wb where wb.isSended is null";
		list = this.find(hql);
		return list;
	}
	
	public void changState(long id){
		String hql = "update YwClosecase wb set wb.isSended='1' where wb.id=:id";
		Query query = this.createQuery(hql);
		query.setLong("id", id);
		query.executeUpdate();
	}
}
